<<<<<<< HEAD
=======
import time
>>>>>>> b27bf6088587585363789403a081b887beb20e22
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
<<<<<<< HEAD
import time
=======
from time import sleep
# # 1、在自己的服务上部署CRMEB
# # 2、写登录——》添加用户分组——》删除用户分组流程
# #实例化驱动
# browser = webdriver.Chrome()#实例化驱动
# #打开网页
# browser.get('http://47.99.105.120:8899/admin/login?redirect=%2Fadmin%2Findex')
# #最大化
# browser.maximize_window()
#
# # 输入账号
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-input__inner')))[0].send_keys("admin")
# # 输入密码
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-input__inner')))[1].send_keys("yinghongnianno.1")
# # 点击登录按钮
# WebDriverWait(browser,10,0.5).until(EC.presence_of_element_located((By.CLASS_NAME,'el-button'))).click()
#
# #点击用户按钮
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'layout-columns')))[1].click()
# #点击用户分组按钮
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-menu-item')))[1].click()
# time.sleep(3)
# #点击添加分组标签
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-button')))[0].click()
# time.sleep(3)
# #添加信息
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-input__inner')))[2].send_keys("626")
# #点击确定按钮
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-button')))[2].click()
# time.sleep(5)
#
# # #点击用户管理
# # WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-menu-item')))[0].click()
# # #点击用户分组按钮
# # time.sleep(1)
# # WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-menu-item')))[1].click()
# # time.sleep(3)
#
# #删除刚刚创建的626
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.XPATH,'//*[text()="删除"]')))[-1].click()
# time.sleep(3)
# #点击确定按钮
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-button')))[2].click()
#
# time.sleep(8)
>>>>>>> b27bf6088587585363789403a081b887beb20e22




#QQ音乐登录
# 实例化驱动
browser = webdriver.Chrome()
# 打开网页
browser.get('https://y.qq.com/portal/pop_login.html')
# 最大化
browser.maximize_window()
#等待
time.sleep(4)


# #点击密码登录
# WebDriverWait(browser,10,0.5).until(EC.presence_of_element_located((By.ID,'switcher_plogin'))).click()
# #输入账号
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'inputstyle')))[1].send_keys("3090317759")
# #输入密码
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'inputstyle')))[2].send_keys("yinghongnianno.1")
# #点击登录按钮
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'btn')))[2].click()
# time.sleep(2)




# 跳进iframe框架(覆盖登录图像)
iframe = WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.TAG_NAME,'iframe')))
browser.switch_to.frame(iframe[0])
# 点击头像框
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'img_out_focus')))[1].click()
browser.find_element(By.XPATH,'//*[@id="img_out_3090317759"]').click()











time.sleep(5)


<<<<<<< HEAD
# #点击用户管理
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-menu-item')))[0].click()
# #点击用户分组按钮
# time.sleep(1)
# WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-menu-item')))[1].click()
# time.sleep(3)


#删除刚刚创建的626
WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.XPATH,'//*[text()="删除"]')))[-1].click()
time.sleep(3)
#点击确定按钮
WebDriverWait(browser,10,0.5).until(EC.presence_of_all_elements_located((By.CLASS_NAME,'el-button')))[2].click()


time.sleep(8)







=======
>>>>>>> b27bf6088587585363789403a081b887beb20e22













































































